package com.hitqz.robot.api.business.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;


/**
 * 设备品牌
 * @author wengyx
 * @date 2024/8/7
 */
public enum EquipmentEnum {

    PTZ(1, "云台转动机构"),

    VISIBLE_LIGHT_CHANNEL(2, "可见光通道"),

    INFRARED_CHANNEL(3, "红外通道"),

    USB_CAMERA(4, "usb相机"),

//    JACKING(5, "顶升机构"),
//    PLC(5, "PLC模块"),

    ARM(6, "机械臂"),

    CHIP(7, "嵌入式控制板"),

    CAR_PLC(8, "PLC模块"),
    //
    OIL_PLC(9, "取油柜PLC模组"),


    ;

    public final static HashMap<Integer, String> TYPE_DES_MAP = new HashMap<>();

    public final static HashMap<Integer, List<BrandEnum>> TYPE_BRAND_MAP = new HashMap<>();


    static {
        for (EquipmentEnum value : values()) {
            EquipmentEnum.TYPE_DES_MAP.put(value.getType(), value.getDes());
        }
        // 品牌映射,用于给前端按类查询
        //云台
        List<BrandEnum> ptzList = new ArrayList<>();
        ptzList.add(BrandEnum.HK);
        ptzList.add(BrandEnum.PELCOD);
        ptzList.add(BrandEnum.DH);
        EquipmentEnum.TYPE_BRAND_MAP.put(PTZ.getType(), ptzList);
        //可见光通道
        List<BrandEnum> visibleLightChannelList = new ArrayList<>();
        visibleLightChannelList.add(BrandEnum.HK);
        visibleLightChannelList.add(BrandEnum.DH);
        EquipmentEnum.TYPE_BRAND_MAP.put(VISIBLE_LIGHT_CHANNEL.getType(), visibleLightChannelList);
        //红外通道
        List<BrandEnum> infraredChannel = new ArrayList<>();
        infraredChannel.add(BrandEnum.HK);
        infraredChannel.add(BrandEnum.DH);
        EquipmentEnum.TYPE_BRAND_MAP.put(INFRARED_CHANNEL.getType(), infraredChannel);
        //usb相机
        List<BrandEnum> usbCameraList = new ArrayList<>();
        usbCameraList.add(BrandEnum.HK);
        usbCameraList.add(BrandEnum.DH);
        EquipmentEnum.TYPE_BRAND_MAP.put(USB_CAMERA.getType(), usbCameraList);
        //嵌入式控制板
        List<BrandEnum> jackingList = new ArrayList<>();
        jackingList.add(BrandEnum.HIT_CHIP);
        EquipmentEnum.TYPE_BRAND_MAP.put(CHIP.getType(), jackingList);
        //机械臂
        List<BrandEnum> armList = new ArrayList<>();
        armList.add(BrandEnum.JAKA);
        armList.add(BrandEnum.DOBOT);
        armList.add(BrandEnum.REALMAN);
        EquipmentEnum.TYPE_BRAND_MAP.put(ARM.getType(), armList);
        // PLC
        List<BrandEnum> plcList = new ArrayList<>();
        plcList.add(BrandEnum.OIL_PLC);
        EquipmentEnum.TYPE_BRAND_MAP.put(OIL_PLC.getType(), plcList);
        List<BrandEnum> oil = new ArrayList<>();
        plcList.add(BrandEnum.CAR_PLC);
        EquipmentEnum.TYPE_BRAND_MAP.put(CAR_PLC.getType(), plcList);

    }


    private Integer type;

    private String des;


    EquipmentEnum(Integer type, String des){
        this.type = type;
        this.des = des;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }
}
